Closed-loop stimulation therapy in event of loss of sensor data

ABSTRACT

A medical device may receive sensor data from sensing sources, and determine confidence levels for sensor data received from each of the plurality of sensing sources. Each of the confidence levels of the sensor data from each of the sensing sources is a measure of accuracy of the sensor data received from respective sensing sources. The medical device may also determine one or more therapy parameter values based on the determined confidence levels, and cause delivery of therapy based on the determined one or more therapy parameter values.

TECHNICAL FIELD

The disclosure relates to therapy delivery by a medical device.

BACKGROUND

Medical devices, such as electrical stimulators or therapeutic agentdelivery devices, may be used in different therapeutic applications,such as deep brain stimulation (DBS), spinal cord stimulation (SCS),pelvic stimulation, gastric stimulation, peripheral nerve stimulation,functional electrical stimulation or delivery of pharmaceutical agent,insulin, pain relieving agent or anti-inflammatory agent to a targettissue site within a patient. A medical device may be configured todeliver therapy to a patient to treat a variety of symptoms or patientconditions such as chronic pain, tremor, Parkinson's disease, othertypes of movement disorders, seizure disorders (e.g., epilepsy), urinaryor fecal incontinence, sexual dysfunction, obesity, mood disorders,gastroparesis or diabetes.

In some therapy systems, an electrical stimulator, which may beimplantable in some instances, delivers electrical therapy to a targettissue site within a patient with the aid of one or more electrodes,which may be deployed by medical leads, on a housing of the electricalstimulator, or both. In addition to or instead of electrical stimulationtherapy, a medical device, which may be implantable in some instances,may deliver a therapeutic agent to a target tissue site within a patientwith the aid of one or more fluid delivery elements, such as a catheteror a therapeutic agent eluting patch.

SUMMARY

The disclosure describes example systems, devices, and methods fortherapy adjustment in response to loss of sensor data, where loss ofsensor data includes full or partial dropout of sensor data. Inautonomous adaptive therapy systems, sensed data is used to adapt thetherapy in real time. However, there may be a reduction in confidence ofthe accuracy of the sensor data due to full or partial dropout of sensordata. With sensor data having reduced accuracy, there may be apossibility that a medical device selects therapy program/parametersthat otherwise should not have been selected because the device reliedon sensor data that was not accurate. In the examples described in thisdisclosure, a medical device may evaluate a set of rules to determinewhich sets of therapy programs/parameters are available for therapydelivery. The set of rules may be based upon the confidence in theaccuracy of sensor data, where complete loss of sensor data results inzero confidence in accuracy of sensor data, and partial loss of sensordata results in non-zero degrees of confidence in accuracy of sensordata.

In one example, the disclosure describes a method of therapy delivery,the method comprising receiving sensor data generated by plurality ofhardware sensing sources, determining confidence levels for sensor datagenerated by each of the plurality of sensing sources, wherein each ofthe confidence levels of the sensor data from each of the sensingsources is a measure of accuracy of the sensor data received fromrespective sensing sources, determining one or more therapy parametervalues based on the determined confidence levels, and causing deliveryof therapy based on the determined one or more therapy parameter values.

In one example, the disclosure describes a medical system for therapydelivery, the medical system comprising a plurality of hardware sensingsources configured to generate sensor data, and a processing circuit.The processing circuit is configured to receive the sensor datagenerated by the plurality of hardware sensing sources, determineconfidence levels for sensor data generated by each of the plurality ofsensing sources, wherein each of the confidence levels of the sensordata from each of the sensing sources is a measure of accuracy of thesensor data received from respective sensing sources, determine one ormore therapy parameter values based on the determined confidence levels,and cause delivery of therapy based on the determined one or moretherapy parameter values.

In one example, the disclosure describes a medical device for therapydelivery, the medical device comprising means for receiving sensor datagenerated by plurality of hardware sensing sources, means fordetermining confidence levels for sensor data generated by each of theplurality of sensing sources, wherein each of the confidence levels ofthe sensor data from each of the sensing sources is a measure ofaccuracy of the sensor data received from respective sensing sources,means for determining one or more therapy parameter values based on thedetermined confidence levels, and means for causing delivery of therapybased on the determined one or more therapy parameter values.

In one example, the disclosure describes a computer-readable storagemedium having instructions stored thereon that when executed cause aprocessing circuit of a medical device for therapy delivery to receivesensor data generated by plurality of hardware sensing sources,determine confidence levels for sensor data generated by each of theplurality of sensing sources, wherein each of the confidence levels ofthe sensor data from each of the sensing sources is a measure ofaccuracy of the sensor data received from respective sensing sources,determine one or more therapy parameter values based on the determinedconfidence levels, and cause delivery of therapy based on the determinedone or more therapy parameter values.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a conceptual diagram illustrating an example deep brainstimulation (DBS) system configured to sense a bioelectrical brainsignal and deliver electrical stimulation therapy to a tissue sitewithin a brain of a patient.

FIG. 2 is functional block diagram illustrating components of an examplemedical device that may form part of the system of FIG. 1.

FIG. 3 is a conceptual diagram illustrating a hierarchy of therapyprograms defining operation of the medical device of FIG. 2 andassociated rules for determining availability of the therapy programs.

FIG. 4 is a flow diagram illustrating an example technique for therapyadjustment in response to loss of sensor data in accordance with one ormore aspects of this disclosure.

FIG. 5 is a functional block diagram illustrating components of anexample external device that may communicate with the medical device ofFIG. 2.

DETAILED DESCRIPTION

The disclosure describes example systems, devices, and methods fortherapy delivery in the event of loss of sensor data from one or moresensing sources. In a closed-loop therapy system, a medical device(e.g., implantable medical device or external device) receives sensordata from one or more sensing sources (e.g., hardware sensing sourcessuch as sensors, sensing circuitry, accelerometers, etc.), anddetermines therapy parameter values (e.g., amplitude, frequency, pulsewidth, etc. in the case of electrical stimulation) based on the sensordata. However, it may be possible for there to be loss of sensor datafrom various causes such as break in a lead, wearing out of anaccelerometer, electrical interference causing loss of communicationbetween an external sensor and the medical device, and the like.

Loss of sensor data is used to generally describe conditions where thedata generated by a sensor may be unavailable or may not be accurate.One example of loss of sensor data may be full dropout of sensor data,where no sensor data is being received from a sensor. Another example ofloss of sensor data may be intermittent or partial dropout of sensordata, where a portion of the sensor data is not received from thesensor. Another example of loss of sensor data may be reception ofsensor data that is outside of a valid range or band. For instance,there may be a maximum possible value and a minimum possible value forthe sensor data (e.g., based on what is being sensed), and loss ofsensor data may include the case where the sensor data is greater thanthe maximum possible value or less than the minimum possible value(e.g., outside of the valid band). Other examples of loss of sensor dataare possible including various examples where the received sensor datamay not be accurate.

Because the medical device may utilize the sensor data for therapyparameter determination (e.g., setting or adjustment), the medicaldevice may determine less effective therapy parameter values when thereceived sensor data is not accurate as compared to when the receivedsensor data is accurate. To minimize selection of less effective therapyparameter values, this disclosure describes example techniques fortherapy parameter determination when there is loss of sensor data. Asone example, this disclosure describes a hierarchical arrangement ofcontrol policies associated with a set of rules. A control policyidentifies a set of therapy parameter values that may be available fordetermining the therapy parameter values of the therapy that is to bedelivered. Each rule identifies a plurality of conditions. As anexample, the plurality of conditions may be conditions related to theaccuracy of the sensor data.

In general, a control policy may be considered as a method to selecttherapy parameter values based on the system's estimated state and thesystem's transfer function. The control policy may determine the set ofparameters based on the current state of the system. For instance, acontrol policy may determine the values of the therapy parameter valuesbased on the current system state.

If the medical device determines that the plurality of conditions of afirst rule are satisfied, then the medical device may determine therapyparameter values from the control policies associated with the firstrule. If, however, the medical device determines that the plurality ofconditions of the first rule are not satisfied, then the medical devicemay determine whether the conditions of a second rule are satisfied, andso forth. If the plurality of conditions is not satisfied for any of therules, then the medical device may determine therapy parameter valuesfrom a default set of control policies that define a default set oftherapy parameter values.

In some examples, the medical device may evaluate confidence levels ofthe sensor data against the conditions of the rules. A confidence levelis a measure of accuracy of sensor data received from respective sensingsources. For example, a high confidence value is indicative of highaccuracy of the sensor data meaning that the sensors are operatingcorrectly. A low, including zero, confidence value is indicative of lowaccuracy of the sensor data meaning that the sensors are not operatingcorrectly or there is dropout in the sensor data or errors in thereception of the sensor data from the sensors, other reasons are alsopossible. There may be various ways in which the medical device maydetermine the confidence level of the sensor data. As one example, themedical device may perform data pre-processing on the received sensordata and determine how many samples are missing or outside of a validband. The confidence level may be inversely proportional to the numberof samples (e.g., sensor data values) in the sensor data that aremissing or outside the valid band (e.g., the more missing or out-of-bandsamples, the lower the confidence level).

The conditions of the rules may be based on comparisons to confidencelevel thresholds. For instance, the conditions for the first rule may bethat the confidence level for the sensor data from all sensing sourcesshould be greater than a particular confidence level threshold, theconditions for the second rule may be that the confidence level forsensor data from all but one sensing source should be greater than afirst confidence level, a second confidence level, and so forth. Basedon the confidence level, the medical device may be configured todetermine therapy parameter values (e.g., by determining therapyparameter values from the control policies associated with the rule forwhich the confidence levels are compliant with all conditions of thatrule).

In some examples, the missing or out-of-band samples may cause themedical device to adjust therapy parameter values. As one example, if anexpected sample is missing, the medical device may determine that theamplitude of the therapy is insufficient, and unnecessarily increaseamplitude.

The medical device may be configured to replace the missing orout-of-band samples, which may result in reduction of unnecessarytherapy adjustment. One example way in which the medical device mayreplace missing or out-of-band samples is to interpolate values based onvalid samples. As an example, the medical device may utilize linearinterpolation with one or more preceding samples to the missing orout-of-band samples and with one or more subsequent samples to themissing or out-of-band samples to generate interpolated sample valuesthat replace (e.g., fill-in) the missing or out-of-band sample values.For instance, the medical device may interpolate sensor data values inerror locations (e.g., missing or out-of-band samples) based on sensordata values in non-error locations of the sensor data.

One example way to determine the confidence levels may be based on theinterpolation. For example, the number of samples for whichinterpolation is performed may be inversely correlated to the confidencelevels (e.g., the more samples that need to be filled in withinterpolation, the lower the confidence level). If greater than athreshold number of samples need to be interpolated (e.g., if there aregreater than a threshold number of interpolated sensor data values),then the medical device may drop down to the default set of controlpolicies.

FIG. 1 is a conceptual diagram illustrating an example therapy system 10that is configured to deliver therapy to patient 12 to manage a disorderof patient 12. In some examples, therapy system 10 may deliver therapyto patient 12 to manage a movement disorder or a neurodegenerativeimpairment of patient 12. Patient 12 ordinarily will be a human patient.In some cases, however, therapy system 10 may be applied to othermammalian or non-mammalian non-human patients. A movement disorder maybe characterized by one or more symptoms, such as, but not limited to,impaired muscle control, motion impairment or other movement problems,such as rigidity, bradykinesia, rhythmic hyperkinesia, non-rhythmichyperkinesia, dystonia, tremor, and akinesia. In some cases, themovement disorder may be a symptom of Parkinson's disease orHuntington's disease. However, the movement disorder may be attributableto other patient conditions.

As additional examples, therapy system 10 may be configured to delivertherapy to manage other patient conditions, such as, but not limited to,seizure disorders (e.g., epilepsy), psychiatric disorders, behaviordisorders, mood disorders, memory disorders, mentation disorders,Alzheimer's disease, or other neurological or psychiatric impairments,in addition to or instead of a movement disorder. Examples ofpsychiatric disorders include major depressive disorder (MDD), bipolardisorder, anxiety disorders, post traumatic stress disorder, dysthymicdisorder, and obsessive compulsive disorder (OCD). Treatment of otherpatient disorders via delivery of therapy to brain 28 or anothersuitable target therapy delivery site in patient 12 are alsocontemplated.

In the example shown in FIG. 1, therapy system 10 includes medicaldevice programmer 14, implantable medical device (IMD) 16, leadextension 18, and one or more leads 20A and 20B (collectively “leads20”) with respective sets of electrodes 24, 26. IMD 16 includes atherapy module that includes a stimulation generator that is configuredto generate and deliver electrical stimulation therapy to one or moreregions of brain 28 of patient 12 via a subset of electrodes 24, 26 ofleads 20A and 20B, respectively. In the example shown in FIG. 1, therapysystem 10 may be referred to as a deep brain stimulation (DBS) systembecause IMD 16 provides electrical stimulation therapy directly totissue within brain 28, e.g., a tissue site under the dura mater ofbrain 28 or one or more branches or nodes, or a confluence of fibertracks. In other examples, leads 20 may be positioned to deliver therapyto a surface of brain 28 (e.g., the cortical surface of brain 28). Insome examples, IMD 16 may provide cortical stimulation therapy topatient 12, e.g., by delivering electrical stimulation to one or moretissue sites in the cortex of brain 28. In some examples, IMD 16 mayprovide vagal nerve stimulation (VNS) therapy to patient 12 bydelivering electrical stimulation to one or more vagal nerve tissuesites.

In still other examples, IMD 16 may provide spinal cord stimulation(SCS), pelvic stimulation, gastric stimulation, peripheral nervestimulation, functional electrical stimulation or delivery of apharmaceutical agent, insulin, pain relieving agent or anti-inflammatoryagent to a target tissue site within a patient. Thus, althoughelectrical stimulation therapy is primarily referred to throughout theremainder of the application, in other examples, therapy system 10 maybe configured to deliver other types of therapy in addition to orinstead of electrical stimulation therapy.

In the example shown in FIG. 1, IMD 16 may be implanted within asubcutaneous pocket in the pectoral region of patient 12. In otherexamples, IMD 16 may be implanted within other regions of patient 12,such as a subcutaneous pocket in the abdomen or buttocks of patient 12or proximate the cranium of patient 12. Implanted lead extension 18 iscoupled to IMD 16 via connector block 30 (also referred to as a header),which may include, for example, electrical contacts that electricallycouple to respective electrical contacts on lead extension 18. Theelectrical contacts electrically couple the electrodes 24, 26 carried byleads 20 to IMD 16. Lead extension 18 traverses from the implant site ofIMD 16 within a chest cavity of patient 12, along the neck of patient 12and through the cranium of patient 12 to access brain 28. IMD 16 can beconstructed of a biocompatible material that resists corrosion anddegradation from bodily fluids. IMD 16 may comprise a hermetic housing34 to substantially enclose components, such as a processor, therapymodule, and memory.

In the example shown in FIG. 1, leads 20 are implanted within the rightand left hemispheres, respectively, of brain 28 in order to deliverelectrical stimulation to one or more regions of brain 28, which may beselected based on many factors, such as the type of patient conditionfor which therapy system 10 is implemented to manage. Other implantsites for leads 20 and IMD 16 are contemplated. For example, IMD 16 maybe implanted on or within cranium 32 or leads 20 may be implanted withinthe same hemisphere at multiple target tissue sites or IMD 16 may becoupled to a single lead that is implanted in one or both hemispheres ofbrain 28.

Leads 20 may be positioned to deliver electrical stimulation to one ormore target tissue sites within brain 28 to manage patient symptomsassociated with a disorder of patient 12. Leads 20 may be implanted toposition electrodes 24, 26 at desired locations of brain 28 throughrespective holes in cranium 32. Leads 20 may be placed at any locationwithin brain 28 such that electrodes 24, 26 are capable of providingelectrical stimulation to target tissue sites within brain 28 duringtreatment. Different neurological or psychiatric disorders may beassociated with activity in one or more of regions of brain 28, whichmay differ between patients. For example, a suitable target therapydelivery site within brain 28 for controlling a movement disorder ofpatient 12 may include one or more of the pedunculopontine nucleus(PPN), thalamus, basal ganglia structures (e.g., globus pallidus,substantia nigra or subthalamic nucleus), zona inserta, fiber tracts,lenticular fasciculus (and branches thereof), ansa lenticularis, and/orthe Field of Forel (thalamic fasciculus). The PPN may also be referredto as the pedunculopontine tegmental nucleus.

As another example, in the case of MDD, bipolar disorder, OCD, or otheranxiety disorders, leads 20 may be implanted to deliver electricalstimulation to the anterior limb of the internal capsule of brain 28,only the ventral portion of the anterior limb of the internal capsule(also referred to as a VC/VS), the subgenual component of the cingulatecortex (which may be referred to as CG25), anterior cingulate cortexBrodmann areas 32 and 24, various parts of the prefrontal cortex,including the dorsal lateral and medial pre-frontal cortex (PFC) (e.g.,Brodmann area 9), ventromedial prefrontal cortex (e.g., Brodmann area10), the lateral and medial orbitofrontal cortex (e.g., Brodmann area11), the medial or nucleus accumbens, thalamus, intralaminar thalamicnuclei, amygdala, hippocampus, the lateral hypothalamus, the Locusceruleus, the dorsal raphe nucleus, ventral tegmentum, the substantianigra, subthalamic nucleus, the inferior thalamic peduncle, the dorsalmedial nucleus of the thalamus, the habenula, the bed nucleus of thestria terminalis, or any combination thereof. Target tissue sites notlocated in brain 28 of patient 12 are also contemplated.

As another example, in the case of a seizure disorder or Alzheimer'sdisease, for example, leads 20 may be implanted to deliver electricalstimulation to regions within the Circuit of Papez, such as, e.g., theanterior thalamic nucleus, the internal capsule, the cingulate, thefornix, the mammillary bodies, the mammillothalamic tract(mammillothalamic fasciculus), and/or hippocampus. For example, in thecase of a seizure disorder, IMD 16 may deliver therapy to a region ofbrain 28 via a selected subset of electrodes 24, 26 to suppress corticalactivity within the anterior thalamic nucleus, hippocampus, or otherbrain region associated with the occurrence of seizures (e.g., a seizurefocus of brain 28). Conversely, in the case of Alzheimer's disease, IMD16 may deliver therapy to a region of brain 28 via electrodes 24, 26 toincrease cortical activity within the anterior thalamic nucleus,hippocampus, or other brain region associated with Alzheimer's disease.As another example, in the case of depression (e.g., MDD), IMD 16 maydeliver therapy to a region of brain 28 via electrodes 24, 26 toincrease cortical activity within one or more regions of brain 28 toeffectively treat the patient disorder. As another example, IMD 16 maydeliver therapy to a region of brain 28 via electrodes 24, 26 todecrease cortical activity within one or more regions of brain 28, suchas, e.g., the frontal cortex, to treat the disorder.

Although leads 20 are shown in FIG. 1 as being coupled to a common leadextension 18, in other examples, leads 20 may be coupled to IMD 16 viaseparate lead extensions or directly coupled to IMD 16. Moreover,although FIG. 1 illustrates system 10 as including two leads 20A and 20Bcoupled to IMD 16 via lead extension 18, in some examples, system 10 mayinclude one lead or more than two leads.

Leads 20 may be implanted within a desired location of brain 28 via anysuitable technique, such as through respective burr holes in the skullof patient 12 or through a common burr hole in the cranium 32. Leads 20may be placed at any location within brain 28 such that electrodes 24,26 of leads 20 are capable of providing electrical stimulation totargeted tissue during treatment. Electrical stimulation generated fromthe stimulation generator (not shown) within the therapy module of IMD16 may help mitigate the symptoms of movement disorders, such as byimproving the performance of motor tasks by patient 12 that mayotherwise be difficult. These tasks may include, for example, at leastone of initiating movement, maintaining movement, grasping and movingobjects, improving gait and balance associated with narrow turns, andthe like. The exact therapy parameter values of the electricalstimulation therapy that may help mitigate symptoms of the movementdisorder (or other patient condition) may be specific for the particulartarget stimulation site (e.g., the region of the brain) involved as wellas the particular patient and patient condition.

In the examples shown in FIG. 1, electrodes 24, 26 of leads 20 are shownas ring electrodes. Ring electrodes may be relatively easy to programand are typically capable of delivering an electrical field to anytissue adjacent to leads 20. In other examples, electrodes 24, 26 ofleads 20 may have different configurations. For example, electrodes 24,26 of leads 20 may have a complex electrode array geometry that iscapable of producing shaped electrical fields, including interleavedstimulation. An example of a complex electrode array geometry, mayinclude an array of electrodes positioned at different axial positionsalong the length of a lead, as well as at different angular positionsabout the periphery, e.g., circumference, of the lead. The complexelectrode array geometry may include multiple electrodes (e.g., partialring or segmented electrodes) around the perimeter of each lead 20, inaddition to, or instead of, a ring electrode. In this manner, electricalstimulation may be directed to a specific direction from leads 20 toenhance therapy efficacy and reduce possible adverse side effects fromstimulating a large volume of tissue. In some examples in which multipleleads 20 are implanted in the same hemisphere surrounding a target,steered electrical stimulation can be performed between two or moreelectrodes.

In some examples, outer housing 34 of IMD 16 may include one or morestimulation and/or sensing electrodes. For example, housing 34 cancomprise an electrically conductive material that is exposed to tissueof patient 12 when IMD 16 is implanted in patient 12, or an electrodecan be attached to housing 34. In other examples, leads 20 may haveshapes other than elongated cylinders as shown in FIG. 1 with active orpassive tip configurations. For example, leads 20 may be paddle leads,spherical leads, bendable leads, or any other type of shape effective intreating patient 12.

IMD 16 may deliver electrical stimulation therapy to brain 28 of patient12 according to one or more stimulation therapy programs. A stimulationtherapy program may define one or more electrical stimulation parametervalues for therapy generated by a therapy module of IMD 16 and deliveredfrom IMD 16 to brain 28 of patient 12. Where IMD 16 delivers electricalstimulation in the form of electrical pulses, for example, theelectrical stimulation parameters may include amplitude mode (constantcurrent or constant voltage), pulse amplitude, pulse width, a waveformshape, etc. In addition, if different electrodes are available fordelivery of stimulation, a therapy parameter of a therapy program may befurther characterized by an electrode combination, which may defineselected electrodes and their respective polarities.

In some examples, IMD 16 is configured to deliver electrical stimulationtherapy to brain 28 of patient 12 in an open loop manner, in which IMD16 delivers the stimulation therapy without intervention from a user ora sensor. In other examples, IMD 16 is configured to deliver electricalstimulation therapy to brain 28 of patient 12 in a closed loop manner,in which IMD 16 controls the timing of the delivery of electricalstimulation to brain 28, the output parameters of the electricalstimulation, or both based on one or more of user input and input fromone or more sensing sources. The sensing sources may, for example,provide feedback that may be used to control the electrical stimulationoutput from IMD 16. For instance, therapy system 10 is an example of anautonomous adaptive system that delivers therapy to patient 12 in amanner that varies in real time according to sense information aboutpatient 12.

For example, the sensor data received from sensing sources formsfeedback that is used to control the therapy parameter values. As anexample, if IMD 16 determines that the amplitude of the sensed signal isgreater than expected (e.g., patient 12 is experiencing too manytremors), IMD 16 may adjust one or more of the amplitude, pulse width,frequency, etc. of the therapy to reduce the amplitude of the sensedsignal. In some examples, IMD 16 may adjust one or more therapyparameter values to increase the amplitude of the sensed signals, suchas in examples where an increase in amplitude of a sensed signal isindicative of efficacy of therapy.

In addition to being configured to deliver therapy to manage a disorderof patient 12, therapy system 10 is configured to sense bioelectricalsignals of patient 12 (e.g., bioelectrical brain signals in the exampleof FIG. 1), as well as other signals. It should be understood that thesensing of bioelectrical signals is not necessary in all examples. Forexample, for motion disorders, the signals may be generated from anaccelerometer or some other device, and not necessarily from abioelectrical signal. In general, the techniques described in thisdisclosure are applicable to examples where the patient generates apatient signal indicative of a patient condition that is measured by oneor more hardware sensing sources. The examples of the hardware sensingsources include sensing circuitry of IMD 16, an accelerometer within IMD16, an accelerometer worn externally by patient 12, electrodes coupledexternally to patient 12, and various other such devices that senseinformation indicative of a patient condition.

In some examples, IMD 16 may include a sensing module that is configuredto sense bioelectrical signals within one or more regions of brain 28via a subset of electrodes 24, 26, another set of electrodes, or both.Accordingly, in some examples, electrodes 24, 26 may be used to deliverelectrical stimulation from the therapy module to target sites withinbrain 28 as well as sense brain signals within brain 28. However, IMD 16can also use a separate set of sensing electrodes to sense thebioelectrical brain signals. In the example shown in FIG. 1, the signalsgenerated by electrodes 24, 26 are conducted to the sensing circuitrywithin IMD 16 via conductors within the respective lead 20A, 20B. Insome examples, the sensing circuitry of IMD 16 may sense bioelectricalsignals via one or more of the electrodes 24, 26 that are also used todeliver electrical stimulation to brain 28. In other examples, one ormore of electrodes 24, 26 may be used to sense bioelectrical signalswhile one or more different electrodes 24, 26 may be used to deliverelectrical stimulation.

Depending on the particular stimulation electrodes and sense electrodesused by IMD 16, IMD 16 may monitor bioelectrical signals and deliverelectrical stimulation at the same region of brain 28 or at differentregions of brain 28. In some examples, the electrodes used to sensebioelectrical signals may be located on the same lead used to deliverelectrical stimulation, while in other examples the electrodes used tosense bioelectrical signals may be located on a different lead than theelectrodes used to deliver electrical stimulation. In some examples, abioelectrical signal of patient 12 may be monitored with externalelectrodes, e.g., scalp electrodes. Moreover, in some examples, thesensing circuitry that senses bioelectrical signals of brain 28 (e.g.,the sensing circuitry that generates an electrical signal indicative ofthe activity within brain 28) is in a physically separate housing fromouter housing 34 of IMD 16. However, in the example shown in FIG. 1 andthe example primarily referred to herein for ease of description, thesensing circuitry and therapy generation circuitry of IMD 16 areenclosed within a common outer housing 34.

The bioelectrical signals sensed by IMD 16 may reflect changes inelectrical current produced by the sum of electrical potentialdifferences across brain tissue. Example bioelectrical brain signalsinclude, but are not limited to, an electroencephalogram (EEG) signal,an electrocorticogram (ECoG) signal, a local field potential (LFP)sensed from within one or more regions of a patient's brain, a microelectrode recording (MER) and/or action potentials from single cellswithin the patient's brain. In some examples, LFP data can be measuredipsilaterally or contralaterally and considered as an average (e.g., amaximum or minimum or a heuristic combination thereof) or as some othervalue. The location at which the sensed signals are obtained may beadjusted according to a disease onset side of the body of patient 12 orseverity of symptoms or disease duration. The adjustments, may, forexample, be made on the basis of clinical symptoms presented and theirseverity, which can be augmented or annotated with recorded LFP data. Aclinician or processing circuitry of IMD 16 may also add heuristicweights to ipsilaterally and/or contralaterally measured LFP data to beconsidered for system feedback.

In addition to bioelectrical signals from the brain, the exampletechniques are applicable to other types of signals such as cardiacsignals, as one example. For example, seizures can sometimes be detectedusing both brain and cardiac (ECG) signals in conjunction, since thecardiac signals change before a seizure. In general, the techniquesdescribed in this disclosure are applicable to various signal types thatare sensed using various sensor types. For instance, the techniques areapplicable to sensor signals from a pressure sensor, cardiac electrogramor ECG sensor, a fluid flow sensor, an arterial venous or tissue oxygen,CO₂, pH (acidity) sensor, a perfusion sensor, a hemoglobin sensor, anaccelerometer (single or multi-axis), a glucose sensor, a potassium orsimilar plasma ion sensor, a temperature sensor, and/or other sensors.

External device 14 is configured to wirelessly communicate with IMD 16as needed to provide or retrieve therapy information. Device 14 is anexternal computing device that the user, e.g., the clinician and/orpatient 12, may use to communicate with IMD 16. For example, device 14may be a clinician programmer that the clinician uses to communicatewith IMD 16 and program one or more therapy programs for IMD 16. Inaddition, or instead, device 14 may be a patient programmer that allowspatient 12 to select programs and/or view and modify therapy parametervalues. The clinician programmer may include more programming featuresthan the patient programmer. In other words, more complex or sensitivetasks may only be allowed by the clinician programmer to prevent anuntrained patient from making undesired changes to IMD 16. Device 14 mayalso be a device used to receive information from IMD 16, and may notnecessarily provide functionality to program therapy.

Device 14 may be a hand-held computing device with a display viewable bythe user and an interface for providing input to device 14 (i.e., a userinput mechanism). For example, device 14 may include a small displayscreen (e.g., a liquid crystal display (LCD) or a light emitting diode(LED) display) that presents information to the user. In addition,device 14 may include a touch screen display, keypad, buttons, aperipheral pointing device or another input mechanism that allows theuser to navigate through the user interface of device 14 and provideinput. If device 14 includes buttons and a keypad, the buttons may bededicated to performing a certain function, i.e., a power button, thebuttons and the keypad may be soft keys that change in functiondepending upon the section of the user interface currently viewed by theuser, or any combination thereof. Alternatively, the screen (not shown)of device 14 may be a touch screen that allows the user to provide inputdirectly to the user interface shown on the display. The user may use astylus or their finger to provide input to the display.

In other examples, device 14 may be a larger workstation or a separateapplication within another multi-function device, rather than adedicated computing device. For example, the multi-function device maybe a notebook computer, tablet computer, workstation, cellular phone,personal digital assistant or another computing device that may run anapplication that enables the computing device to operate as a securemedical device 14. A wireless adapter coupled to the computing devicemay enable secure communication between the computing device and IMD 16.

When device 14 is configured for use by the clinician, device 14 may beused to transmit initial programming information to IMD 16. This initialinformation may include hardware information, such as the type of leads20, the arrangement of electrodes 24, 26 on leads 20, the position ofleads 20 within brain 28, initial programs defining therapy parametervalues, and any other information that may be useful for programminginto IMD 16. Device 14 may also be capable of completing functionaltests (e.g., measuring the impedance of electrodes 24, 26 of leads 20).

The clinician may also generate and store therapy programs within IMD 16with the aid of device 14. During a programming session, the clinicianmay determine one or more therapy programs that may provide efficacioustherapy to patient 12 to address symptoms associated with the movementdisorder (or other patient conditions). For example, the clinician mayselect one or more electrode combinations with which stimulation isdelivered to brain 28. During the programming session, patient 12 mayprovide feedback to the clinician as to the efficacy of the specificprogram being evaluated or the clinician may evaluate the efficacy basedon one or more sensed or observable physiological parameters of patient(e.g., muscle activity) or based on motion detected via one or moremotion sensors that generate signals indicative of motion of patient 12.Device 14 may assist the clinician in the creation/identification oftherapy programs by providing a methodical system for identifyingpotentially beneficial therapy parameter values.

Device 14 may also be configured for use by patient 12. When configuredas a patient programmer, device 14 may have limited functionality(compared to a clinician programmer) in order to prevent patient 12 fromaltering critical functions of IMD 16 or taking actions that may bedetrimental to patient 12.

Whether device 14 is configured for clinician or patient use, device 14is configured to communicate with IMD 16 and, optionally, anothercomputing device, via wireless communication. Device 14, for example,may communicate via wireless communication with IMD 16 using radiofrequency (RF) telemetry techniques known in the art. Device 14 may alsocommunicate with another programmer or computing device via a wired orwireless connection using any of a variety of local wirelesscommunication techniques, such as RF communication according to the802.11 or Bluetooth specification sets, infrared (IR) communicationaccording to the IRDA specification set, or other standard orproprietary telemetry protocols. Device 14 may also communicate withother programming or computing devices via exchange of removable media,such as memory cards. Further, device 14 may communicate with IMD 16 andanother programmer via remote telemetry techniques known in the art,communicating via a local area network (LAN), wide area network (WAN),public switched telephone network (PSTN), or cellular telephone network,for example.

In accordance with the example techniques described in this disclosure,IMD 16 may be configured to deliver therapy to patient 12 in a closedloop manner. For instance, as noted above, IMD 16 may deliver therapy inan autonomous adaptive system in which therapy to the patient varies inreal time according to sense information.

In such closed loop systems, the behavior of the system andcorresponding safety for patient 12 should be controlled in the eventthat the sensed information, which forms the feedback from which therapyis determined, is lost or is otherwise unreliable. In such examples, IMD16 may adjust therapy in a “graceful” manner upon loss of data, andcontinue to safely deliver useful therapy to patient 12.

For instance, a dropout in sensor data or out-of-band sensor data maycause IMD 16 to determine that a patient characteristic is differentthan the actual patient characteristic, and IMD 16 may unnecessarilyadjust therapy parameter values. Avoiding the determination of therapyparameter values based on dropped or out-of-band sensor data may beinsufficient to ensure that the correct therapy will be selected asthere can be a reduction in confidence that the remaining sample values(e.g., in-band) in the sensor data are accurate.

In examples described in this disclosure, IMD 16 may utilize ahierarchical structure of defined control policies, where each of thecontrol policies defines a plurality of therapy parameter values. As oneexample, the hierarchical structure of defined control policies may be alayered hierarchy of therapy programs, with the bottom layer includingone or more “default” therapy programs that can be delivered under allcircumstances.

IMD 16 may determine confidence levels for the received sensor data todetermine which control policies are available, where each of thecontrol policies defines a set of therapy parameter values and/ortherapy programs that are available for therapy delivery. In general,IMD 16 may determine one or more confidence levels for sensor datareceived from each of the plurality of sensors, where each of theconfidence levels of the sensor data from each of the sensing sources isa measure of accuracy of the sensor data received from respectivesensing sources. IMD 16 may determine one or more therapy parametervalues based on the determined one or more confidence levels, and oneexample way in which IMD 16 determines the one or more therapy parametervalues is via the use of control policies.

In some examples, IMD 16 may interpolate sample values (e.g., linearinterpolation, but other interpolation types are possible) for theout-of-band or missing sample values. This may allow for a reasonablevalue to substitute for the invalid value (e.g., out-of-band or missingsample value), and the therapy program that IMD 16 is executing mayreceive a stream of sensor data without invalid values, which couldcause an error in the execution of the therapy program. In other words,from the perspective of the therapy program, there was no change in thesensor data. This way, changes to the therapy program to avoid theprocessing of invalid values may not be needed as the therapy programreceives a stream of sensor data with substituted values and, as aresult, without any invalid values.

There may be various ways in which IMD 16 may determine the confidencevalues. As one example, IMD 16 may determine a number of error locationsin the received sensor data, or a number of interpolated sample values,where the error locations include invalid data (e.g., out-of-bounds ormissing sample values). IMD 16 may determine the confidence level basedon at least one of the determined number of error locations or thenumber of interpolated sample values. As another example, IMD 16 maydetermine a number of data packet losses (including partial packet loss)in the received sensor data. Examples of data packet loses include lossof packet that includes header information that should be availableregardless of the values of the sensor data, loss of packet ofcommunication information during configuration, and the like. IMD 16 maydetermine the confidence level based on the determined number of datapacket losses.

As an example, if there is no invalid and/or interpolated data, then theconfidence level is 100%, if 1% of the sensor data is invalid and/orinterpolated, then the confidence level is 99%, and so forth. As anotherexample, if there is greater than 80% packet loss, then the confidencelevel is zero. In general, the confidence level is inversely correlatedto the amount of invalid and/or interpolated data. Also, in the aboveexample, the confidence level is a percentage value; however, theexample techniques are not so limited. In some examples, the confidencelevel may be a binary value (e.g., confidence level of one indicatesdata is accurate, and confidence level of zero indicates data is notaccurate).

Referring back to the hierarchical structure, each of the layers may beassociated with a rule (e.g., a set of conditions), where IMD 16determines whether each of the conditions is true or false based on acomparison of the confidence levels to the conditions. If all conditionsof the rule are true, then IMD 16 may select therapy parameter valuesfrom the control policies available for the layer associated with thatrule. If one condition of the rule is false, then IMD 16 may determinewhether each of the conditions of the rule associated with the nextlayer is true, and repeat these operations until IMD 16 determines a setof available control policies.

It may be possible that IMD 16 determines that the one or moreconfidence levels are not compliant with one or more conditions of allof the rules. In such examples, IMD 16 may determine whether conditionsassociated with using a set of default therapy parameter values is met.An example of the rule associated with the default therapy parametervalues is an amount of time since the last change in the selectedtherapy parameter values (e.g., the condition is whether the therapyparameter values have changed or not changed in a certain amount oftime). IMD 16 may ramp up or ramp down the therapy parameter values tothe default therapy parameter values in a controlled manner so that theloss of sensor data may not lead to overly abrupt change in therapy.

Whether the conditions of the rule, associated with the default therapyparameter values, are met may not be dependent upon the sensor data.This way, the default therapy parameter values are available forselection even when there is complete loss of sensor data or completeloss in confidence of sensor data. Also, the conditions of the rule,associated with the default therapy parameter values, may be such thatall conditions of the rule are met when none of the other rules aresatisfied.

System 10 shown in FIG. 1 is merely one example of a therapy system thatis configured to perform the techniques described in this disclosure.Systems with other configurations of leads, electrodes, and sensors arepossible. For example, in other implementations, IMD 16 may be coupledto additional leads or lead segments having one or more electrodespositioned at different target tissue sites, which may be within brain28 or outside of brain (e.g., proximate to a spinal cord of patient 12,a peripheral nerve of patient 12, a muscle of patient 12, or any othersuitable therapy delivery site). The additional leads may be used fordelivering different stimulation therapies to respective stimulationsites within patient 12 or for monitoring at least one physiologicalparameter of patient 12.

Additionally, in other examples, a system may include more than one IMD.For example, a system may include two IMDs coupled to respective one ormore leads. Each IMD can deliver stimulation to a respective lateralside of patient 12 in some examples.

As another example configuration, a therapy system can include one ormore leadless electrical stimulators (e.g., microstimulators having asmaller form factor than IMD 16 and may not be coupled to any separateleads). The leadless electrical stimulators can be configured togenerate and deliver electrical stimulation therapy to patient 12 viaone or more electrodes on an outer housing of the electrical stimulator.In examples including a plurality of leadless electrical stimulators,the leadless electrical stimulators can be implanted at different targettissue sites within patient 12. One electrical stimulator may act as a“master” module that coordinates the delivery of stimulation to patient12 via the plurality of electrical stimulators.

In some examples, IMD 16 is not configured to deliver electricalstimulation therapy to brain of patient 12, but, rather, is onlyconfigured to sense one or more physiological parameters of patient 12,including a bioelectrical brain signal of patient 12. This type of IMD16 may be a patient monitoring device useful for diagnosing patient 12,monitoring a patient condition 12, or to train IMD 16 or another IMD fortherapy delivery.

FIG. 2 is functional block diagram illustrating components of an exampleIMD 16. In the example shown in FIG. 2, IMD 16 includes processingcircuit 60, memory 62, signal generator circuit 64, electrical sensingcircuit 66, switch circuit 68, telemetry circuit 70, and accelerometer80. In addition, FIG. 2 illustrates sensor 74, which may be a sensingsource that patient 12 wears such as on the wrist or coupled to thehead. In other examples, sensor 74 could comprise one or moreimplantable sensors implanted at one or more locations within thepatient's body that may be remote from IMD 16. For instance, sensorshoused in small injectable capsules could be positioned at locationsremote to IMD 16 and communicate with IMD via telemetry circuit 70 insome cases.

Memory 62, as well as other memories described herein, may include anyvolatile or non-volatile media, such as a random access memory (RAM),read only memory (ROM), non-volatile RAM (NVRAM), electrically erasableprogrammable ROM (EEPROM), flash memory, and the like. Memory 62 maystore computer-readable instructions that, when executed by processingcircuit 60, cause IMD 16 to perform various functions described herein.

In the example shown in FIG. 2, memory 62 stores therapy programs 72,rules and control policies 76, operating instructions 78, datapre-processor application 82, interpolation application 84, confidencelevel application 86, and therapy determination application 88. Forpurposes of illustration, the example techniques described in thisdisclosure are described with respect to processing circuit 60 executingthe applications stored in memory 62, which in turn cause processingcircuit 60 to perform the example techniques. However, processingcircuit 60 may be hardwired to perform the example techniques describedin this disclosure. Therefore, although the example techniques aredescribed with respect to applications executed on programmablecircuitry of processing circuit 60, the example techniques may be formedby fixed-function circuitry of processing circuit 60 or a combination offixed-function and programmable circuitry of processing circuit 60.

Rules and control policies 76 store information indicative of conditionsof a rule and a set of control policies associate with the rule. Therapyprograms 72 define particular programs of therapy in terms of respectivevalues for electrical stimulation parameters, such as a stimulationelectrode combination, electrode polarity, current or voltage amplitude,and, if signal generator circuit 64 generates and delivers stimulationpulses, the therapy programs may define values for a pulse width andpulse rate of a stimulation signal. Rules and control policies 76 maydefine which ones of therapy programs 72, or which therapy parametervalues more generally, are associated with which layer, and which rulesare associated with which layer. Thereby, rules and control policies 76indicate which therapy parameter values are available for selection whenconditions of a particular rule are satisfied (e.g., the confidencelevels are compliant with conditions of a rule).

In some examples, memory 62 may also store brain signal or other sensingdata generated by sensing circuit 66 via at least one of electrodes 24,26 and, in some cases, a reference electrode on outer housing 34 of IMD16 or another reference electrode. In addition, in some examples,processing circuit 60 may append a time and date stamp to the brainsignal data in memory 62. Operating instructions 78 guide generaloperation of IMD 16 under control of processing circuit 60, and mayinclude instructions for monitoring brains signals within one or morebrain regions via electrodes 24, 26 and delivering electricalstimulation therapy to patient 12. Signal generator circuit 64, underthe control of processing circuit 60, generates stimulation signals fordelivery to patient 12 via selected combinations of electrodes 24, 26.In some examples, signal generator circuit 64 generates and deliversstimulation signals to one or more target regions of brain 28 (FIG. 1),via a selected combination of electrodes 24, 26, based on one or morestored therapy programs 72 (or more generally therapy parameter values)that are available based on the satisfaction of conditions in rules andcontrol policies 76. The target tissue sites within brain 28 forstimulation signals or other types of therapy may depend on the patientcondition for which therapy system 10 is implemented to manage. Whilestimulation pulses are described, stimulation signals may be of otherforms, such as continuous-time signals (e.g., sine waves) or the like.

The processing circuit described in this disclosure, includingprocessing circuit 60, may include one or more digital signal processors(DSPs), general purpose microprocessors, application specific integratedcircuits (ASICs), field programmable logic arrays (FPGAs), or otherequivalent integrated or discrete logic circuitry, or combinationsthereof. The functions attributed to the processing circuit describedherein may be provided by a hardware device and embodied as software,firmware, hardware, or any combination thereof. Processing circuit 60 isconfigured to control signal generator circuit 64 according to therapyprograms 72 by memory 62 to apply particular stimulation parametervalues specified by one or more programs.

In the example shown in FIG. 2, the set of electrodes 24 of lead 20Aincludes electrodes 24A, 24B, 24C, and 24D, and the set of electrodes 26of lead 20B includes electrodes 26A, 26B, 26C, and 26D. Processingcircuit 60 may control switch circuit 68 to apply the stimulationsignals generated by signal generator circuit 64 to selectedcombinations of electrodes 24, 26. In particular, switch circuit 68 maycouple stimulation signals to selected conductors within leads 20,which, in turn, deliver the stimulation signals across selectedelectrodes 24, 26. Switch circuit 68 may be a switch array, switchmatrix, multiplexer, or any other type of switching circuit configuredto selectively couple stimulation energy to selected electrodes 24, 26and to selectively sense bioelectrical brain signals with selectedelectrodes 24, 26. Hence, signal generator circuit 64 is coupled toelectrodes 24, 26 via switch module 68 and conductors within leads 20.In some examples, however, IMD 16 does not include switch circuit 68.

Switch circuit 68 is illustrated as merely one example. In someexamples, IMD 16 may not include switch circuit 68. Rather, IMD 16 mayinclude a plurality of stimulation sources such as current sources thatsink or source current and/or a voltage sources that output a positiveor a negative voltage. In such examples, each one of electrodes 24, 26may be coupled to separate ones of the stimulation sources. In someexamples, some of electrodes 24, 26 may be coupled to the samestimulation source, and other electrodes may be coupled to anotherstimulation source, with the possibility that one stimulation sourcecouples to a plurality of electrodes 24, 26. In examples where IMD 16does not include switch circuit 68, processing circuit 60 and/or signalgenerator circuit 64 may selectively enable stimulation sources todeliver the stimulation.

Signal generator circuit 64 may be a single channel or multi-channelstimulation generator. In particular, signal generator circuit 64 may becapable of delivering a single stimulation pulse, multiple stimulationpulses or a continuous signal including a plurality of frequencycomponents at a given time via a single electrode combination ormultiple stimulation pulses at a given time via multiple electrodecombinations. In some examples, however, signal generator circuit 64 andswitch circuit 68 may be configured to deliver multiple channels on atime-interleaved basis. For example, switch circuit 68 may serve to timedivide the output of signal generator circuit 64 across differentelectrode combinations at different times to deliver multiple programsor channels of stimulation energy to patient 12.

Sensing circuit 66, under the control of processing circuit 60, and asan example of a sensing source, is configured to sense bioelectricalsignals of patient 12 via a selected subset of electrodes 24, 26 or withone or more electrodes 24, 26 and at least a portion of a conductiveouter housing 34 of IMD 16, an electrode on an outer housing of IMD 16or another reference. Processing circuit 60 may control switch circuit68 to electrically connect sensing circuit 66 to selected electrodes 24,26. In this way, sensing circuit 66 may selectively sense bioelectricalbrain signals with different combinations of electrodes 24, 26 (and/or areference other than an electrode 24, 26). Processing circuit 60 maymonitor the efficacy of therapy delivery by IMD 16 via the sensedbioelectrical brain signals and determine whether the efficacy oftherapy delivery has changed, and, in response, generate a notification(e.g., to patient 12 or patient caretaker).

Although sensing circuit 66 is incorporated into a common housing 34with signal generator circuit 64 and processing circuit 60 in FIG. 2, inother examples, sensing circuit 66 is in a separate outer housing fromouter housing 34 of IMD 16 and communicates with processing circuit 60via wired or wireless communication techniques. In the techniquesdescribed in this disclosure, the patient signal sensed via sensingcircuit 66 is one example of a patient signal indicative of a patientcondition. For instance, the patient signal may be a sensed LFP signal.

Accelerometer 80 may generate a patient signal based on patientmovement. As one example, accelerometer 80 may generate a patient signalhaving the same frequency as patient tremor. Accelerometer 80 may beutilized for purposes other than patient tremor detection. In addition,rather than or in addition to accelerometer 80, IMD 16 may includeanother device type such as a gyroscope that generates a patient signalbased on patient movement. As another example, sensor 74 may be agyroscope.

Also, accelerometer 80 (and possibly sensor 74) may not be necessary inevery example. For instance, in examples where the techniques are forsensed patient signals such as those from sensing circuit 66,accelerometer 80 and sensor 74 may not be necessary, but may still beincluded. In examples where accelerometer 80 and/or sensor 74 is used,accelerometer 80 need not necessarily reside within IMD 16, and mayreside elsewhere, including surgically implanted locations withinpatient 12. In some cases, an accelerometer may be in a small injectablehousing similar to an injectable capsule for injecting at a selectedlocation within the patient's body. Such an accelerometer 80 maycommunicate with IMD via telemetry circuit 70 in some instances.

Sensor 74 may communicate sensor data with processing circuit 60 viatelemetry circuit 70. For example, sensor 74 may establish acommunication session with processing circuit 60 via telemetry circuit70. Part of establishing the communication session may be transferringof data packets back and forth. Once the communication session isestablished, sensor 74 may provide sensor data to processing circuit 60.

As illustrated, processing circuit 60 receives sensor data (e.g., thebioelectrical signal) from sensing circuit 66, which is configured tosense the bioelectrical signal via one or more of electrodes 24, 26.Processing circuit 60 also receives sensor data from accelerometer 80and sensor 74. As described above, in the techniques described in thisdisclosure, the sensed bioelectrical signal and the signal received fromaccelerometer 80 and sensor 74 are examples of sensor data. There may beadditional examples of sensor data, such as other signals that aregenerated by the patient or are generated in response to behavior. Ingeneral, the sensor data that processing circuit 60 receives may beindicative of a patient condition (e.g., patient tremors).

Although three sensing sources are illustrated (e.g., sensing circuit66, accelerometer 80, and sensor 74 are examples of hardware sensingsources), the techniques are not so limited. There may be fewer sensingsources, including a single sensing source, or there may be more sensingsources than those illustrated in FIG. 2.

Each of sensing circuit 66, accelerometer 80, and/or sensor 74 (e.g.,each of the sensing sources) may store respective sensor data in memory62 (e.g., via a direct connection to memory 62 and under control ofprocessing circuit 60 or via telemetry circuit 70). In the exampletechniques described in this disclosure, processing circuit 60 mayexecute data pre-processor application 82. In response to executingapplication 82, processing circuit 60 may receive, possibly from memory62, sample values of sensor data from one or more sensing sources. Inthis way, processing circuit 60 may receive sensor data from one or moresensing sources.

Processing circuit 60, via application 82, may determine whether eachsample value from sensor data from respective sensing sources is validor invalid. As one example, for sample values from each sensing source,there may be a predetermined range, stored in memory 62 or memory ofprocessing circuit 60, and if values from the sensing source are withinthat range, the values are valid. If the values from the sensing sourceare outside that range, the values are invalid. Invalid data also refersto lost or dropped sample values (e.g., where a sample value is expectedbut none is received). Processing circuit 60 may compare each of thesample values from respective sensing sources to the respectivepredetermined ranges. If processing circuit 60 determines that the valueis out-of-band (e.g., outside the valid range), processing circuit 60,via application 82, may identify the locations in the sensor data samplevalue stream where the sample value is invalid. Optionally, processingcircuit 60 may identify the sensor data that is valid, or a combinationof both.

Processing circuit 60 may store information identifying the samplevalues that are invalid or identifying the sample values that are valid,or both. In this way, processing circuit 60 may determine errorlocations in the received sensor data, where the error locations includeinvalid data. Processing circuit 60 may store information of the errorlocations, or more generally, the number of invalid sample values inmemory 62 and/or local memory.

Although not necessary in all examples, processing circuit 60 mayexecute interpolation application 84. Processing circuit 60, viaapplication 84, may generate replacement values for the invalid values.There may be various algorithms to interpolate. As one example,processing circuit 60, via application 84, may interpolate based onsensor data values (e.g., sample values) in non-error locations of thesensor data to generate interpolated data values. For instance,processing circuit 60 may interpolate sensor data values in the errorlocations based on sensor data values in non-error locations of thesensor data. The interpolations may be linear interpolation (e.g.,average of sensor data value of immediately preceding non-error locationrelative to error location and sensor data value of immediatelysubsequent non-error location relative to error location) but otherinterpolation techniques may be possible. Processing circuit 60, viaapplication 84, may identify which are the replacement values. In thisway, processing circuit 60, via application 82 and application 84, mayflag sample values as being either an observed data point (e.g., valid),an invalid data point, or, as applicable, an interpolated/extrapolateddata point.

Processing circuit 60 may execute confidence level application 86.Processing circuit 60 may execute application 86 before, in parallelwith, or after execution of application 84, in examples where processingcircuit 60 executes interpolation application 84. Processing circuit 60,via application 86, may determine confidence levels for sensor datareceived from each of the plurality of sensing sources, where each ofthe confidence levels of the sensor data from each of the sensingsources is a measure of accuracy of the sensor data received fromrespective sensing sources.

As one example, processing circuit 60, via application 82, may havemarked each error location in the sensor data (e.g., store informationidentifying the sample values that are invalid or identifying the samplevalues that are valid, or both). In such example, processing circuit 60,via application 86, may determine at least one of a number of errorlocations in the received sensor data or a number of interpolated samplevalues, where the error locations include invalid data. Processingcircuit 60, via application 86, may determine the one or more confidencelevels based on at least one of the determined number of error locationsor the number of interpolated sample values. As another example,processing circuit 60, via application 82, may have determined a numberof data packet losses in the received sensor data. The data packet mayinclude measured sample values of sensore, but need not necessarily besample values of sensor data. For instance, the data packets may beheader information and like, and although not sensor data, loss of datapackets may be indicative that the received sensor data is not accuratebecause the interconnection between sensor and IMD 16 may be poor.Processing circuit 60, via application 86, may determine the one or moreconfidence levels based on the number of data packets losses in thereceived sensor data.

For instance, processing circuit 60 may determine that 1% of data isinvalid for a particular sensing source, and determine that theconfidence level for the sensor data from that sensing source is 99%,determine that 2% of data is invalid for a particular sensing source,and determine that the confidence level for the sensor data from thatsensing source is 98%, and so forth. As another example, processingcircuit 60 may determine that if a particular percentage (e.g., 80%) ofthe data is valid for a particular sensing source, then the confidencelevel is a digital one (indicating confidence), and if less than theparticular percentage (e.g., 80%) of the data is valid for a particularsensing source, then the confidence level is a digital zero (indicatingno confidence). Processing circuit 60 may similarly use loss of datapackets for determining confidence level.

Processing circuit 60 may execute therapy determination application 88to determine one or more therapy parameter values based on one or moreconfidence levels. For instance, processing circuit 60 may store theconfidence levels, as generated from the execution of application 86 inlocal memory or memory 62. Then, based on the confidence levels,processing circuit 60 may determine therapy parameter values (e.g.,determine a therapy program from therapy programs 72 that corresponds tothe determined therapy parameter values).

One way to determine the therapy parameter values is based on rules andcontrol policies 76. Processing circuit 60, via application 88, maydetermine a plurality of available control policies in rules and controlpolices 76 based on the confidence levels. As described above, rules andcontrol policies 76 may define a plurality of therapy parameter values.In some examples, the plurality of therapy parameter values defined byrules and control policies 76 may include a range of therapy parametervalues, and rules and control policies 76 may define maximum and minimumtherapy parameter values, and possibly a rate at which the therapyparameter values can be adjusted. In one example, processing circuit 60,via application 88, may determine a manner in which to ramp (e.g., rampup or ramp down) the therapy parameter values of the therapy currentlybeing delivered based on the plurality of available control policies.

For example, based on the plurality of available control policies,processing circuit 60 may determine that the amplitude can reach amaximum of a particular amplitude. Also, processing circuit 60 mayutilize the received sensor data to determine what the amplitude of thetherapy should be. As an example, if the received sensor data indicatesthat the therapy is not sufficiently addressing the disorder (e.g., anamplitude of the sensor data is greater than expected, or amplitude ofthe sensor data is less than expected), then processing circuit 60, viaapplication 88, may determine what the amplitude, pulse width,frequency, and/or other parameter value. for the therapy should be suchthat the received sensor data indicates that the therapy is sufficientlyaddressing the disorder.

Processing circuit 60 may then ramp the amplitude of the therapy basedon the determination of what the therapy parameter values of the therapyshould be and the maximum or minimum values for the therapy parametervalues. In this example, if the confidence level of the sensor data thatprocessing circuit 60 uses to determine that the amplitude should beincreased is relatively low, then the available control policies may besuch that the maximum allowable amplitude (e.g., selectable by a user orclinician) is limited to be less than a maximum amplitude. In this case,even if the processing circuit 60 determines that the amplitude of thetherapy should be greater than the maximum allowable amplitude (e.g.,based on the sensor data which may not be sufficiently accurate), theactual amplitude may be limited by the available control policies to beno more than the maximum allowable amplitude.

In some examples, in determining which control policies of rules andcontrol polices 76 are available, processing circuit 60, via application88, may weigh one or more of the confidence levels differently. Forexample, the sensor data from a first sensing source may be a betterindicator of the therapy as compared to sensor data from a secondsensing source. In this example, if the confidence level of the sensordata from the first sensing source is lower than the confidence level ofthe senor data from the second sensing source, then IMD 16 may furtherlimit the available control policies, as compared to the case where theconfidence level of the sensor data from the second sensing source islower than the confidence level of the sensor data from the firstsensing source. Accordingly, processing circuit 60, via application 88,may weigh the confidence level of the sensor data from the first sensormore heavily than the confidence level of the sensor data from thesecond sensor in determining the available control policies. Here,weighing more heavily means that the confidence level of the sensor datafrom the first sensor has a greater effect in determining which controlpolicies are available as compared to the confidence level of the sensordata from the second sensor.

Processing circuit 60, via therapy determination application 88, may usethe confidence levels to determine which control policies in rules andcontrol policies 76 are available. In this disclosure, the confidencelevel used to determine which control policies are available is used toencompass both the examples where non-weighted confidence levels areused and examples where weighted confidence levels are used.

To determine which control policies in rules and control policies 76 areavailable, processing circuit 60, via application 88, may repeatedlydetermine whether the one or more confidence levels are compliant withone or more conditions of the plurality of rules in rules and controlpolicies 76 until the one or more confidence levels are compliant withone or more conditions of a rule of the plurality of rules (e.g., untilcondition or conditions of a rule are satisfied). Processing circuit 60,via application 88, may determine a set of available therapy parametervalues associated with a rule. For example, processing circuit 60, viaapplication 88, may determine which control policies are associated withthe rule, and determine which set of therapy parameter values define theavailable control policies. In this example, processing circuit 60, viaapplication 88, may determine one or more therapy parameter values basedon the determined set of available therapy parameter values.

As an example, processing circuit 60, via therapy determinationapplication 88, may determine whether the confidence levels arecompliant with conditions of a first rule that is associated with a setof available therapy parameter values. Processing circuit 60, viatherapy determination application 88, may determine the one or moretherapy parameter values based on the set of available therapy parameterfor the first rule.

However, processing circuit 60, via therapy determination application88, may determine that the confidence levels are not compliant with theconditions of the first rule. In this case, subsequent to determiningthat the one or more confidence levels are not compliant with theconditions of the first rule, processing circuit 60, via therapydetermination application 88, may determine that the confidence levelsare compliant with the conditions of a second rule. In this example,processing circuit, via therapy determination application 88, maydetermine the therapy parameter values based on the set of availabletherapy parameter values associated with the second rule.

In some cases, processing circuit 60, via therapy determinationapplication 88, may determine that the confidence levels are notcompliant with conditions of any of the rules. In such examples, inresponse to determining that the confidence levels are not compliantwith conditions of the rules, processing circuit 60, via therapydetermination application 88, may determine that conditions associatedwith using a set of default therapy parameter values are met. Ingeneral, the conditions associated with the set of default therapyparameter values should be selected such that the conditions are alwaysmet if the conditions for all other rules are not met. Processingcircuit 60, via therapy determination application 88, may determine thetherapy parameter values based on the set of default therapy parametervalues in response to the conditions associated with using the set ofdefault therapy parameter values being met.

In this way, processing circuit 60 may determine the therapy parametervalues for the therapy that is to be delivered. In some examples,processing circuit 60 may identify a therapy program from therapyprograms 72 that includes therapy parameter values closest to those ofthe determined therapy parameter values, or may generate a new therapyprogram that includes the determined therapy parameter values.Processing circuit 60 may then cause signal generator circuit 64 todeliver therapy based on the determined one or more therapy parametervalues.

Accordingly, processing circuit 60 may utilize data-signal-specificvalidation criteria (e.g., evaluating the confidence levels against theconditions of the rules) that indicates whether the invalid samplevalues or interpolated/extrapolated sample values within a current timerange is small enough (e.g., the number of errors in small enough) forthe sensor data to be considered valid for determining therapy, or toospeculative (not sufficiently reliable because there are too manyerrors) to be utilized. For instance, the conditions of a rule may neverbe satisfied (e.g., a rule can never be considered true) when sensordata involved in evaluating the rule is considered too speculative touse. The sensor data may be considered too speculative, for example, ifthe confidence level of the sensor data is below a threshold, indicatingthat the sensor data therefore should not be used for determiningtherapy parameter values.

Telemetry circuit 70 is configured to support wireless communicationbetween IMD 16 and an external device 14, sensor 74, or anothercomputing device. Processing circuit 60 of IMD 16 may receive, asupdates to programs, values for various stimulation parameters such asamplitude and electrode combination, from device 14 via telemetrycircuit 70. The updates to the therapy programs may be stored withintherapy programs 72 of memory 62. Telemetry circuit 70 in IMD 16, aswell as telemetry circuits in other devices and systems describedherein, such as device 14, may accomplish communication by RFcommunication techniques. In addition, telemetry circuit 70 maycommunicate with external device 14 via proximal inductive interactionof IMD 16 with device 14. Accordingly, telemetry circuit 70 may sendinformation to device 14 on a continuous basis, at periodic intervals,or upon request from IMD 16 or device 14. For example, processingcircuit 60 may transmit brain state information to device 14 viatelemetry circuit 70.

Although not illustrated, IMD 16 includes a power source that deliversoperating power to various components of IMD 16. The power source mayinclude a small rechargeable or non-rechargeable battery and a powergeneration circuit to produce the operating power. Recharging may beaccomplished through proximal inductive interaction between an externalcharger and an inductive charging coil within IMD 16. In some examples,power requirements may be small enough to allow IMD 16 to utilizepatient motion and implement a kinetic energy-scavenging device totrickle charge a rechargeable battery. In other examples, traditionalbatteries may be used for a limited period of time.

FIG. 3 is a conceptual diagram illustrating hierarchy of therapyprograms and associated rules. For instance, FIG. 3 illustrates anexample data structure for rules and control policies 76 that memory 62may store. For each rule, there may be associated one or moreconditions, which may be considered as a Boolean combination ofpredicates that, when true, indicate which therapy parameter values areavailable.

Processing circuit 60 may determine whether the confidence levels arecompliant with the conditions of a first rule. A first rule may includethe conditions that confidence levels of sensor data from sensingsources is greater than 80%. If the Boolean condition that allconfidence levels from all sensor sources are greater than 80% is true,then processing circuit 60 may select from any of the control policiesfrom A1-D4.

If processing circuit 60 determines that the confidence levels are notcompliant with the conditions of the first rule, processing circuit 60determines whether the confidence rules are compliant with theconditions of a second rule. In FIG. 3, a second rule may include theconditions that the confidence levels of sensor data from first andsecond sensing sources is greater than 80%, and a confidence level froma third sensing source is less than 80%. If the Boolean AND combinationof the conditions of the second rule are true (i.e., confidence levelsof sensor data from first and second sensing sources is greater than 80%AND a confidence level from a third sensing source is less than 80%),then processing circuit 60 may select from the control policies from A1,A2, A3, B1, B2, B3, C1, and C2. In this example, the control policiesfor the second rule are a subset of the control policies of the firstrule. In general, the therapy parameter values for a second ruleassociated with control policies that are lower in the hierarchicallayers of control policies may be a subset of therapy parameter valuesfor a first rule associated with control policies that are higher in thehierarchical layers.

In the example illustrated in FIG. 3, if the confidence levels for allsensing sources is less than 20%, then only control policies A1, B1, andA2 may be available. In this example, A1, B1, and A2 represent defaultparameters. Processing circuit 60 may determine that A1, B1, and A2 arethe only available control policies based on the confidence levels beingbelow a minimum confidence threshold level (e.g., 20% in this example).

FIG. 4 is a flow diagram illustrating an example technique in accordancewith one or more aspects of this disclosure. Processing circuit 60 mayreceive sensor data generated by one or more hardware sensing sources(90). As an example, each of the sensing sources may store the sensordata generated by respective sensing sources in memory 62 or some otherstorage location. Processing circuit 60 may execute data pre-processorapplication 82 to retrieve the stored sensor data.

In addition, processing circuit 60, via application 82, may identifywhich sample values for the sensor data are invalid and/or valid. Insome examples, processing circuit 60 may execute interpolationapplication 84 to generate interpolated values that fill in for theinvalid data. Processing circuit 60, via application 84, may identifysample values that were interpolated/extrapolated.

Processing circuit 60 may determine one or more confidence levels forsensor data generated by each of the plurality of sensing sources, whereeach of the confidence levels of the sensor data from each of thesensing sources is a measure of accuracy of the sensor data receivedfrom respective sensing sources (92). As one example, processing circuit60 may execute confidence level application 86 to determine a number ofinvalid values or interpolated/extrapolated values, and determine theconfidence level based on the number of invalid orinterpolated/extrapolated values. As another example, processing circuit60 may execute confidence level application 86 to determine a number ofdata packet losses, and determine the confidence level based on thenumber of data packet losses.

With the execution of therapy determination application 88, processingcircuit 60 may determine one or more therapy parameter values based onthe determined confidence levels (94). In addition to the confidencelevels, processing circuit 60, via application 88, may utilize thesample values (e.g., interpolated and actual values) to determine thetherapy parameter values. As an example, application 88 may causeprocessing circuit 60 to determine available control policies based onthe confidence levels, and determine a manner in which to ramp (e.g.,ramp up or ramp down) therapy parameter values based on the availablecontrol policies and the sensor data.

In general, application 88 may cause processing circuit 60 to repeatedlydetermine whether the confidence levels are compliant with conditions ofrules until the confidence levels are compliant with conditions of arule. Processing circuit 60 may determine a set of available therapyparameter values associated with the rule, and determine the one or moretherapy parameter values based on the determined set of availabletherapy parameter values.

For instance, processing circuit 60 may determine that the confidencelevels are compliant with conditions of a rule, where the rule isassociated with a set of available therapy parameter values. Processingcircuit 60 may determine the one or more therapy parameter values basedon the set of available therapy parameter values.

However, in some cases, processing circuit 60 may determine that theconfidence levels are not compliant with conditions of a first rule,where the first rule is associated with a first set of available therapyparameter values, and subsequent to determining that the confidencelevels are not compliant with the conditions of the first rule,determine that the confidence levels are compliant with conditions of asecond rule, where the second rule is associated with a second set ofavailable therapy parameter values. In this example, processing circuit60 may determine the one or more therapy parameter values based on thesecond set of available therapy parameter values. The second set ofavailable therapy parameter values may be a subset of the first set ofavailable therapy parameter values.

In some cases, processing circuit 60 may determine that the confidencelevels are not compliant with conditions of one or more rules, and inresponse to determining that the confidence levels are not compliantwith conditions of one or more rules, determine that conditionsassociated with using a set of default therapy parameter values are met.In such cases, processing circuit 60 may determine the one or moretherapy parameter values based on the set of default therapy parametervalues in response to the conditions associated with using the set ofdefault therapy parameter values being met. Processing circuit 60 maydetermine the one or more therapy parameter values based on the set ofdefault therapy parameter values in response to the confidence levelsbeing below a minimum confidence threshold level.

Processing circuit 60 may use the actual the confidence levels todetermine the one or more therapy parameter values, but the exampletechniques are not so limited. In some examples, processing circuit 60weigh one or more of the confidence levels (e.g., assign differentweights to the confidence levels). Processing circuit 60 may thendetermine the therapy parameter value(s) based on the weightedconfidence levels.

As an example, sensor data from a first sensor may be more useful indetermining therapy parameter values as compared to sensor data from asecond sensor. In such an example, if the sensor data from the firstsensor is accurate (e.g., high confidence level), then even if thesensor data from the second sensor is not very accurate (e.g., lowconfidence level), processing circuit 60 may not need to adjust thetherapy parameter values. However, if the sensor data form the firstsensor is not very accurate, and the sensor data from the second sensoris accurate, processing circuit 60 may substantially adjust the therapyparameter values. Accordingly, the effect of sensor data from differentsensors on the therapy parameters may not all be the same.

To account for the different importance of the sensor data, processingcircuit 60 may weigh the confidence levels. For example, processingcircuit 60 may assign a higher weight to confidence level for the firstsensor than the weight to the confidence level for the second sensor.Processing circuit 60 may then average the weighted confidence levels todetermine an average weighted confidence level that processing circuit60 uses to determine the therapy parameter values. By weighting, theconfidence level of the sensor data that has greater effect on thedetermination of the therapy parameters may drive the determination ofthe therapy parameter values. In this disclosure, determining therapyparameter values based on the confidence levels includes both theexample where weighting is used and the example where weighting is notused.

Processing circuit 60 may cause delivery of therapy based on thedetermined therapy parameter values (96). For instance, processingcircuit 60 may control signal generator circuit 64 to deliver therapybased on the determined therapy parameter values. As an example,processing circuit 60 may cause signal generator circuit 64 to ramp theone or more therapy parameter values in the manner determined from theavailable control policies.

In this manner, the example techniques may promote ways in which toensure the proper therapy is delivered even in instances where there issensor data loss or dropout. For example, IMD 16 may be operatingcorrectly and delivering therapy based on measurements from one or moresensors, but due to patient movement or adjustment or damage to asensor, there may be dropout of the sensor data from one or more of thesensors. The example techniques may address this potential issue byimplementing an algorithm of determining the confidence of the receivedsensor data. If there is high confidence in the received sensor data,then IMD 16 may continue operating normally. However, if there is lowconfidence in the received sensor data, then IMD 16 may re-determine thetherapy parameter values to provide effective therapy and minimizeunintended results.

FIG. 5 is a functional block diagram illustrating components of anexample external device 14. External device 14 may operate as a patientprogrammer or clinician programmer configured to permit a user toprogram and/or control therapy parameter values of IMD 16. Externaldevice 14 includes processing circuit 98, memory 100, telemetry circuit102, user interface 104, and power source 106. Processing circuit 98controls user interface 104 and telemetry circuit 102, and stores andretrieves information and instructions to and from memory 100. Device 14may be configured for use as a clinician programmer or a patientprogrammer. Processing circuit 98 may comprise any combination of one ormore processors including one or more microprocessors, DSPs, ASICs,FPGAs, or other equivalent integrated or discrete logic circuitry.Accordingly, processing circuit 98 may include any suitable structure,whether in hardware, software, firmware, or any combination thereof, toperform the functions ascribed herein to processing circuit 98.

A user, such as a clinician or patient 12, may interact with device 14through user interface 104. User interface 104 includes a display (notshown), such as a LCD or LED display or other type of screen, with whichprocessing circuit 98 may present information related to the therapy. Inaddition, user interface 104 may include an input mechanism to receiveinput from the user. The input mechanisms may include, for example,buttons, a keypad (e.g., an alphanumeric keypad), a peripheral pointingdevice or another input mechanism that allows the user to navigatethrough user interfaces presented by processing circuit 98 of device 14and provide input.

If device 14 includes buttons and a keypad, the buttons may be dedicatedto performing a certain function (i.e., a power button), or the buttonsand the keypad may be soft keys that change function depending upon thesection of the user interface currently viewed by the user. In addition,or instead, the screen (not shown) of programmer 14 may be a touchscreen that allows the user to provide input directly to the userinterface shown on the display. The user may use a stylus or theirfinger to provide input to the display. In other examples, userinterface 104 also includes audio circuitry for providing audiblenotifications, instructions or other sounds to patient 12, receivingvoice commands from patient 12, which may be useful if patient 12 haslimited motor functions, or both. Patient 12, a clinician or anotheruser may also interact with device 14 to manually select therapyprograms, generate new therapy programs, modify therapy programs throughindividual or global adjustments, and transmit the new programs to IMD16.

In some examples, at least some of the control of therapy delivery byIMD 16 may be implemented by processing circuit 98 of device 14. Forinstance, the example techniques described above with respect toprocessing circuit 60 of IMD 16 may be implemented in other examples, atleast in part, by processing circuit 98, or the combination ofprocessing circuit 60 and processing circuit 98 may perform the exampletechniques. As one example, processing circuit 98 may receive sensordata that telemetry circuit 70 outputs to telemetry circuit 102.Processing circuit 98 may determine confidence levels, and determinetherapy parameter values based on the confidence levels. Processingcircuit 98 may then cause IMD 16 to deliver therapy based on thedetermined therapy parameter values.

Memory 100 may include instructions for operating user interface 104 andtelemetry circuit 102, and for managing power source 106. In someexamples, memory 100 may also store any therapy data retrieved from IMD16 during the course of therapy, biomarker information, sensedbioelectrical brain signals, and the like. In some instances, theclinician may use this therapy data to determine the progression of thepatient condition in order to plan future treatment for the movementdisorder (or other patient condition) of patient 12. Memory 100 mayinclude any volatile or nonvolatile memory, such as RAM, ROM, EEPROM orflash memory. Memory 100 may also include a removable memory portionthat may be used to provide memory updates or increases in memorycapacities. A removable memory may also allow sensitive patient data tobe removed before device 14 is used by a different patient.

Wireless telemetry in device 14 may be accomplished by RF communicationor proximal inductive interaction of external device 14 with IMD 16.This wireless communication is possible through the use of telemetrycircuit 102. Accordingly, telemetry circuit 102 may be similar to thetelemetry circuit contained within IMD 16. In other examples, device 14may be capable of infrared communication or direct communication througha wired connection. In this manner, other external devices may becapable of communicating with device 14 without needing to establish asecure wireless connection.

Power source 106 is configured to deliver operating power to thecomponents of device 14. Power source 106 may include a battery and apower generation circuit to produce the operating power. In someexamples, the battery may be rechargeable to allow extended operation.Recharging may be accomplished by electrically coupling power source 106to a cradle or plug that is connected to an alternating current (AC)outlet. In addition, recharging may be accomplished through proximalinductive interaction between an external charger and an inductivecharging coil within device 14. In other examples, traditional batteries(e.g., nickel cadmium or lithium ion batteries) may be used. Inaddition, device 14 may be directly coupled to an alternating currentoutlet to operate.

While the techniques described above are primarily described as beingperformed by processing circuit 60 of IMD 16, in other examples, one ormore other circuits may perform any part of the techniques describedherein alone or in addition to processor 60. Thus, reference to “aprocessing circuit” may refer to “one or more processing circuits.”Likewise, “one or more processing circuits” may refer to a singleprocessing circuit or multiple processing circuits in differentexamples.

The techniques described in this disclosure, including those attributedto IMD 16, external device 14, or various constituent components, may beimplemented, at least in part, in hardware, software, firmware or anycombination thereof. For example, various aspects of the techniques maybe implemented within one or more processing circuits, including one ormore microprocessors, DSPs, ASICs, FPGAs, or any other equivalentintegrated or discrete logic circuitry, as well as any combinations ofsuch components, embodied in programmers, such as clinician or patientprogrammers, medical devices, or other devices.

In one or more examples, the functions described in this disclosure maybe implemented in hardware, software, firmware, or any combinationthereof If implemented in software, the functions may be stored on, asone or more instructions or code, a computer-readable medium andexecuted by a hardware-based processing unit. Computer-readable mediamay include computer-readable storage media forming a tangible,non-transitory medium. Instructions may be executed by one or moreprocessors, such as one or more DSPs, ASICs, FPGAs, general purposemicroprocessors, or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor” or “processing circuit” asused herein may refer to one or more of any of the foregoing structureor any other structure suitable for implementation of the techniquesdescribed herein.

It will be understood that the techniques described in this disclosuremay be utilized to deliver therapy to a patient to treat a variety ofsymptoms or patient conditions such as chronic pain, Parkinson'sdisease, other types of movement disorders, seizure disorders (e.g.,epilepsy), urinary or fecal incontinence, sexual dysfunction, obesity,mood disorders (e.g., depression), gastroparesis or diabetes.Additionally, while the patient signal indicative of a patient conditionmay be based on patient movement as sensed by an accelerometer orgyroscope, the patient signal could alternatively or additionally beother physiological signals.

In addition, in some aspects, the functionality described herein may beprovided within dedicated hardware and/or software executing onhardware. Depiction of different features is intended to highlightdifferent functional aspects and does not necessarily imply that suchfeatures must be realized by separate hardware or software components.Rather, the functionality may be performed by separate hardware orsoftware components, or integrated within common or separate hardware orsoftware components. Also, the techniques could be fully implemented inone or more circuits or logic elements. The techniques of thisdisclosure may be implemented in a wide variety of devices orapparatuses, including an IMD, an external device, a combination of anIMD and external device, an integrated circuit (IC) or a set of ICs,and/or discrete electrical circuitry, residing in an IMD and/or externaldevice.

Various examples have been described. These and other examples arewithin the scope of the following claims.

What is claimed is:
 1. A method of therapy delivery, the methodcomprising: receiving sensor data generated by plurality of hardwaresensing sources; determining confidence levels for sensor data generatedby each of the plurality of sensing sources, wherein each of theconfidence levels of the sensor data from each of the sensing sources isa measure of accuracy of the sensor data received from respectivesensing sources; determining one or more therapy parameter values basedon the determined confidence levels; and causing delivery of therapybased on the determined one or more therapy parameter values.
 2. Themethod of claim 1, further comprising: determining a plurality ofavailable control policies based on the determined confidence levels,wherein each of the control policies defines a plurality of therapyparameter values, wherein determining the one or more therapy parametervalues comprises determining a manner in which to ramp the one or moretherapy parameter values based on the plurality of available controlpolicies and the sensor data, and wherein causing delivery of therapycomprises ramping the one or more therapy parameter values in thedetermined manner.
 3. The method of claim 1, further comprising:weighting each of the confidence levels, wherein determining the one ormore therapy parameter values comprises determining the one or moretherapy parameter values based on the weighted confidence levels.
 4. Themethod of claim 1, further comprising: repeatedly determining whetherthe confidence levels are compliant with conditions of a plurality ofrules until the confidence levels are compliant with the conditions of arule of the plurality of rules; and determining a set of availabletherapy parameter values associated with the rule, wherein determiningthe one or more therapy parameter values comprises determining the oneor more therapy parameter values based on the determined set ofavailable therapy parameter values.
 5. The method of claim 1, furthercomprising: determining that the confidence levels are compliant withconditions of a rule, wherein the rule is associated with a set ofavailable therapy parameter values, wherein determining the one or moretherapy parameter values comprises determining the one or more therapyparameter values based on the set of available therapy parameter valuesassociated with the rule.
 6. The method of claim 1, further comprising:determining that the confidence levels are not compliant with conditionsof a first rule, wherein the first rule is associated with a first setof available therapy parameter values; and subsequent to determiningthat the confidence levels are not compliant with the conditions of thefirst rule, determining that the confidence levels are compliant withconditions of a second rule, wherein the second rule is associated witha second set of available therapy parameter values, wherein determiningthe one or more therapy parameter values comprises determining the oneor more therapy parameter values based on the second set of availabletherapy parameter values.
 7. The method of claim 6, wherein the secondset of available therapy parameter values is a subset of the first setof available therapy parameter values.
 8. The method of claim 1, furthercomprising: determining that the confidence levels are not compliantwith conditions of one or more rules; and in response to determiningthat the confidence levels are not compliant with conditions of one ormore rules, determining that conditions associated with using a set ofdefault therapy parameter values are met, wherein determining the one ormore therapy parameter values comprises determining the one or moretherapy parameter values based on the set of default therapy parametervalues in response to the conditions associated with using the set ofdefault therapy parameter values being met.
 9. The method of claim 8,wherein determining the one or more therapy parameter values based onthe set of default therapy parameter values comprises determining theone or more therapy parameter values based on the set of default therapyparameter values in response to the confidence levels being below aminimum confidence threshold level.
 10. The method of claim 1, furthercomprising: determining error locations in the received sensor data,wherein the error locations include invalid data; and interpolatingsensor data values in the error locations based on sensor data values innon-error locations of the sensor data.
 11. The method of claim 1,further comprising: determining at least one of a number of errorlocations in the received sensor data or a number of interpolated sensordata values, wherein the error locations include invalid data, whereindetermining the confidence levels comprises determining the confidencelevels based on at least one of the determined number of error locationsor the number of interpolated sensor data values.
 12. The method ofclaim 1, further comprising: determining a number of data packet lossesin the received sensor data, wherein determining the confidence levelscomprises determining the confidence levels based on the determinednumber of data packet losses.
 13. A medical system for therapy delivery,the medical system comprising: a plurality of hardware sensing sourcesconfigured to generate sensor data; and a processing circuit configuredto: receive the sensor data generated by the plurality of hardwaresensing sources; determine confidence levels for sensor data generatedby each of the plurality of sensing sources, wherein each of theconfidence levels of the sensor data from each of the sensing sources isa measure of accuracy of the sensor data received from respectivesensing sources; determine one or more therapy parameter values based onthe determined confidence levels; and cause delivery of therapy based onthe determined one or more therapy parameter values.
 14. The medicalsystem of claim 13, further comprising an implantable medical device(IMD), wherein the IMD comprises the plurality of hardware sensingsources and the processing circuit, and wherein the IMD furthercomprises a signal generator circuit for delivery of the therapy. 15.The medical system of claim 13, further comprising an implantablemedical device (IMD) and an external device, external to the IMD,wherein the external device comprises the processing circuit, andwherein the IMD comprises the plurality of hardware sensing sources anda signal generator circuit for delivery of the therapy.
 16. The medicalsystem of claim 13, wherein the processing circuit is configured to:determine a plurality of available control policies based on thedetermined confidence levels, wherein each of the control policiesdefines a plurality of therapy parameter values, wherein to determinethe one or more therapy parameter values, the processing circuit isconfigured to determine a manner in which to ramp the one or moretherapy parameter values based on the plurality of available controlpolicies and the sensor data, and wherein to cause delivery of therapy,the processing circuit is configured to ramp the one or more therapyparameter values in the determined manner.
 17. The medical system ofclaim 13, wherein the processing circuit is configured to: weight eachof the confidence levels, wherein to determine the one or more therapyparameter values, the processing circuit is configured to determine theone or more therapy parameter values based on the weighted confidencelevels.
 18. The medical system of claim 13, wherein the processingcircuit is configured to: repeatedly determine whether the confidencelevels are compliant with conditions of a plurality of rules until theconfidence levels are compliant with the conditions of a rule of theplurality of rules; and determine a set of available therapy parametervalues associated with the rule, wherein to determine the one or moretherapy parameter values, the processing circuit is configured todetermine the one or more therapy parameter values based on thedetermined set of available therapy parameter values.
 19. The medicalsystem of claim 13, wherein the processing circuit is configured to:determine that the confidence levels are compliant with conditions of arule, wherein the rule is associated with a set of available therapyparameter values, and wherein to determine the one or more therapyparameter values, the processing circuit is configured to determine theone or more therapy parameter values based on the set of availabletherapy parameter values associated with the rule.
 20. The medicalsystem of claim 13, wherein the processing circuit is configured to:determine that the confidence levels are not compliant with conditionsof a first rule, wherein the first rule is associated with a first setof available therapy parameter values; and subsequent to determiningthat the confidence levels are not compliant with the conditions of thefirst rule, determine that the confidence levels are compliant withconditions of a second rule, wherein the second rule is associated witha second set of available therapy parameter values, and wherein todetermine the one or more therapy parameter values, the processingcircuit is configured to determine the one or more therapy parametervalues based on the second set of available therapy parameter values.21. The medical system of claim 20, wherein the second set of availabletherapy parameter values is a subset of the first set of availabletherapy parameter values.
 22. The medical system of claim 13, whereinthe processing circuit is configured to: determine that the confidencelevels are not compliant with conditions of one or more rules; and inresponse to determining that the confidence levels are not compliantwith conditions of one or more rules, determine that conditionsassociated with using a set of default therapy parameter values are met,and wherein to determine the one or more therapy parameter values, theprocessing circuit is configured to determine the one or more therapyparameter values based on the set of default therapy parameter values inresponse to the conditions associated with using the set of defaulttherapy parameter values being met.
 23. The medical system of claim 22,wherein to determine the one or more therapy parameter values based onthe set of default therapy parameter values, the processing circuit isconfigured to determine the one or more therapy parameter values basedon the set of default therapy parameter values in response to theconfidence levels being below a minimum confidence threshold level. 24.The medical system of claim 13, wherein the processing circuit isconfigured to: determine error locations in the received sensor data,wherein the error locations include invalid data; and interpolate sensordata values in the error locations based on sensor data values innon-error locations of the sensor data.
 25. The medical system of claim13, wherein the processing circuit is configured to: determine at leastone of a number of error locations in the received sensor data or anumber of interpolated sensor data values, wherein the error locationsinclude invalid data, and wherein to determine the confidence levels,the processing circuit is configured to determine the confidence levelsbased on at least one of the determined number of error locations or thenumber of interpolated sensor data values.
 26. The medical system ofclaim 13, wherein the processing circuit is configured to: determine anumber of data packet losses in the received sensor data, and wherein todetermine the confidence levels, the processing circuit is configured todetermine the confidence levels based on the determined number of datapacket losses.
 27. A medical device for therapy delivery, the medicaldevice comprising: means for receiving sensor data generated byplurality of hardware sensing sources; means for determining confidencelevels for sensor data generated by each of the plurality of sensingsources, wherein each of the confidence levels of the sensor data fromeach of the sensing sources is a measure of accuracy of the sensor datareceived from respective sensing sources; means for determining one ormore therapy parameter values based on the determined confidence levels;and means for causing delivery of therapy based on the determined one ormore therapy parameter values.
 28. The medical device of claim 27,further comprising: means for repeatedly determining whether theconfidence levels are compliant with conditions of a plurality of rulesuntil the confidence levels are compliant with the conditions of a ruleof the plurality of rules; and means for determining a set of availabletherapy parameter values associated with the rule, wherein the means fordetermining the one or more therapy parameter values comprises means fordetermining the one or more therapy parameter values based on thedetermined set of available therapy parameter values.
 29. Acomputer-readable storage medium having instructions stored thereon thatwhen executed cause a processing circuit of a medical device for therapydelivery to: receive sensor data generated by plurality of hardwaresensing sources; determine confidence levels for sensor data generatedby each of the plurality of sensing sources, wherein each of theconfidence levels of the sensor data from each of the sensing sources isa measure of accuracy of the sensor data received from respectivesensing sources; determine one or more therapy parameter values based onthe determined confidence levels; and cause delivery of therapy based onthe determined one or more therapy parameter values.
 30. Thecomputer-readable storage medium of claim 29, further comprisinginstructions that cause the processing circuit to: repeatedly determinewhether the confidence levels are compliant with conditions of aplurality of rules until the confidence levels are compliant with theconditions of a rule of the plurality of rules; and determine a set ofavailable therapy parameter values associated with the rule, wherein theinstructions that cause the processing circuit to determine the one ormore therapy parameter values comprise instructions that cause theprocessing circuit to determine the one or more therapy parameter valuesbased on the determined set of available therapy parameter values.